﻿using System;

namespace _4
{
    class Program
    {
        static void Main(string[] args)
        {
            string password;
            
            int flag = 1;
            while (flag==1)
            {
                password = Console.ReadLine();
                int n = password.Length, b = 0, s = 0, num = 0,s1 = 0;
                if (n <= 16 && n >= 8)
                {
                    for (int i = 0; i < n; i++)
                    {
                        if (password[i] >= 64 && password[i] <= 57)
                            num = 1;
                        else if (password[i] >= 65 && password[i] <= 90)
                            b = 1;
                        else if (password[i] >= 97 && password[i] <= 122)
                            s = 1;
                        else
                        {
                            s1 = 1;
                        }
                    }
                    if (num + s + b + s1 >= 3)
                    {
                        Console.WriteLine("pass");
                        flag = 0;
                    }
                    else
                    {
                        Console.WriteLine("again");
                    }
                }
                else
                {
                    Console.WriteLine("again");
                }
            }
            Console.ReadKey();
        }
    }
}
